package com.bustle.product;

import java.util.List;

import javax.ejb.EJB;
import javax.ejb.Local;
import javax.ejb.Stateless;

import com.bustle.product.dto.provider.ProviderDto;
import com.bustle.product.proxy.ProviderDtoDaoProxy;

@Local
public interface ProviderDtoManager
{

  public List<ProviderDto> getListProvider();
  public ProviderDto getById(int idProvider);

  @Stateless
  public class DefaultProviderManager implements ProviderDtoManager
  {

    @EJB
    private ProviderDtoDaoProxy providerDtoDao;

    @Override
    public List<ProviderDto> getListProvider()
    {
      return providerDtoDao.retrieveAll();
    }

    @Override
    public ProviderDto getById(int idProvider)
    {
      return providerDtoDao.retrieve(idProvider);
    }

  }

}
